<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="root">
    <input type="text">
    <div></div>
</div>
</body>
<script>
    const input = document.querySelector("input");
	const div = document.querySelector("#root div");
	const data = {
		username:"zhangsan"
    };
	input.value = div.innerText = data.username;
	input.oninput = function(){
		div.innerText = this.value;
    }

</script>
</html>